package com.example.shiro.shiro.service.impl;

import com.example.shiro.shiro.model.Log;
import com.example.shiro.shiro.service.LogService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.jdbc.core.JdbcTemplate;
import org.springframework.stereotype.Service;

/**
 * @author chong
 * @create 2020/4/3
 * Desc:
 */
@Service
public class LogServiceImpl implements LogService {

    @Autowired
    private JdbcTemplate jdbcTemplate;


    @Override
    public void insertLog(Log log) {
        String sql = "insert into log (userId,userName) values (?,?)";
        jdbcTemplate.update(sql, new Object[]{log.getUserId(),log.getUserName()});
    }
}
